package com.cmict.data.infra.dal.dataobject.message;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import com.cmict.data.framework.mybatis.core.dataobject.BaseDO;
import com.cmict.data.infra.api.emus.MessageTypeEnum;
import com.cmict.data.infra.api.emus.NotifyRecipientFilterTypeEnum;
import com.cmict.data.infra.api.emus.NotifySendTypeEnum;
import com.cmict.data.infra.enums.message.AnnouncementStatusEnum;
import com.cmict.data.infra.enums.message.NotifyChannelEnum;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

/**
 * 公告信息
 *
 * @author hccake 2020-12-15 17:01:15
 */
@Data
@TableName(value = "notify_announcement", autoResultMap = true)
@Schema(title = "公告信息")
public class Announcement  extends BaseDO {

	private static final long serialVersionUID = 1L;

	public static final String TABLE_ALIAS = "a";

	/**
	 * ID
	 */
	@TableId
	@Schema(title = "ID")
	private Long id;

	/**
	 * 标题
	 */
	@Schema(title = "标题")
	private String title;

	/**
	 * 内容
	 */
	@Schema(title = "内容")
	private String content;

	/**
	 * 内容显示字段
	 */
	@Schema(title = "内容显示字段")
	private String contentDisplay;

	@Schema(title = "短信内容")
	private String smsContent;
	/**
	 * 附属url
	 */
	@Schema(title = "附属url")
	private String url;

	/**
	 * 附属url
	 */
	@Schema(title = "系统模板id")
	private Long templateId;



	/**
	 * 消息类型
	 * @see MessageTypeEnum
	 */
	@Schema(title = "消息类型")
	private Integer type;

	/**
	 * 接收人筛选方式
	 * @see NotifyRecipientFilterTypeEnum
	 */
	@Schema(title = "接收人筛选方式")
	private Integer recipientFilterType;

	/**
	 * 对应接收人筛选方式的条件信息，多个用逗号分割。如角色标识，组织ID，用户类型，用户ID等
	 */
	@TableField(typeHandler = JacksonTypeHandler.class)
	@Schema(title = "对应接收人筛选方式的条件信息。如角色标识，组织ID，用户类型，用户ID等")
	private List<Long> recipientFilterCondition;

	/**
	 * 接收方式，值与通知渠道一一对应
	 * @see NotifyChannelEnum
	 */
	@TableField(typeHandler = JacksonTypeHandler.class)
	@Schema(title = "接收方式")
	private List<Integer> receiveMode;

	/**
	 * 消息发送类型
	 * @see NotifySendTypeEnum
	 */
	@Schema(title = "消息发送类型")
	private Integer sendAction;

	/**
	 * 消息发送时间
	 */
	@Schema(title = "消息发送时间")
	private LocalDateTime sendTime;

	/**
	 * 状态
	 * @see AnnouncementStatusEnum
	 */
	@Schema(title = "状态")
	private Integer status;

	/**
	 * 是否开启超时提醒
	 */
	@Schema(title = "是否开启超时提醒")
	private Boolean isRemind  ;
	/**
	 * 超时时间
	 */
	@Schema(title = "超时时间")
	private BigDecimal time;
	/**
	 * 消息间隔
	 */
	@Schema(title = "消息间隔")
	private BigDecimal message;
	/**
	 * 推送次数
	 */
	@Schema(title = "推送次数")
	private Integer frequency;

	/**
	 * 已完成 推送次数
	 */
	@Schema(title = "已完成 推送次数")
	private Integer completerFrequency;
	/**
	 * 超时唯一标识
	 */
	@Schema(title = "超时唯一标识")
	private String remindId;

	/**
	 * 附件
	 */
	@Schema(title = "附件")
	private String allFileList;
    /**
     * 超时唯一标识
     */
    @TableField(exist = false)
    public String username;
}
